https://glot.io/snippets/frm114q8rc/raw/main.lua